package com.bootdo.thread;

/**
 * @Auther: liuj
 * @Date: 2019/5/12 21:02
 * @Description:
 */
public class MyRunnable implements Runnable {
    @Override
    public void run() {
        System.out.println("run: " + Thread.currentThread().getName());
    }

    public static void main(String[] args){
        System.out.println("main : " + Thread.currentThread().getName());
        MyRunnable myRunnable = new MyRunnable();

        new Thread(myRunnable, "线程1").start();

        new Thread(new Runnable() {
            @Override
            public void run() {
                for(int i=0; i<10; i++){
                    System.out.println("Thread : " + Thread.currentThread().getName());
                }
            }
        }).start();
    }
}
